/******************************************************************************************
 * Import
 ******************************************************************************************/

// module
import React, {Component} from 'react';
import {View} from 'react-native';

// project
import {
    Text,  ItemX, Hand, Between, TouchOpacity, Header, Footer
} from '../../../library'
import { hash } from 'rsvp';

/******************************************************************************************
 * Export Class
 ******************************************************************************************/

export default class ChildHead extends Component {

    /*------------------------------------------------------------------------------------
	 * 初始化
	 *-----------------------------------------------------------------------------------*/
	constructor(props) {
        super(props);

        /**
         * state
         */
        this.state = {

        };
    }

    /*------------------------------------------------------------------------------------
	 * 自定义方法
	 *-----------------------------------------------------------------------------------*/

	/*------------------------------------------------------------------------------------
	 * 渲染
	 *-----------------------------------------------------------------------------------*/
	render() {
        const goback = this.props.goback?true:false;
        const title = this.props.title?this.props.title:"";
        const dosome = this.props.dosome?true:false;
        const EonPress = this.props.title?this.props.title:{};
        // 渲染
		return (


            <Header x='center'>
                <ItemX f="1" bg="white" px="10">
                    <Between>

                        <Hand f="0.3" h="45" y="center" x="left">
                            <TouchOpacity  onPress={
                               () => {}
                            }>
                                {goback?<Text bg="red">返回图标</Text>:<Text></Text>}
                            </TouchOpacity>
                        </Hand>

                        <Hand f="0.3" y="center" h="45" x="center">
                            <Text size="16">{ title }</Text>
                        </Hand>

                        <Hand f="0.3" h="45" y="center" x="right">

                            {dosome?
                            <TouchOpacity px="10" py="5" bg="#eaa70f" ra="5" onPress={ EonPress }>
                                <Text size="14"  color="#fff">
                                操作
                                </Text>
                            </TouchOpacity>
                            :<Text></Text>}


                        </Hand>

                    </Between>
                </ItemX>


            </Header>

		);
	}
}
